package utils;

import java.sql.Connection;
import java.sql.SQLException;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;

public class UtilidadesConexion {

	public static Connection getConnectionFromTomcatPool() throws NamingException, SQLException{
		Context ctx = new InitialContext();
		Context envctx =  (Context) ctx.lookup("java:/comp/env");
		DataSource dataSource =  (DataSource) envctx.lookup("jdbc/sveDB");
		Connection conn = dataSource.getConnection();
		return conn;
	}
	
}
